new bool:IsSpec[MAXPLAYERS+1] = false
new Handle:g_Spec = INVALID_HANDLE

public Action:Do_Spec(client, args)
{
	new clients = GetClientCount(true)
	if	(clients <= 1)
	{
		if (Debug)
			PrintToChat(client, "CLIENT <= 1 NOT SPECTATING")
		return Plugin_Handled
	}

	if (GetConVarInt(FindConVar("mp_respawndelay")) != 0)
	{
		PrintToChat(client, "mp_respawndelay is not 0. Please contact the Admin.")
		return Plugin_Handled
	}

	if (GetConVarInt(g_Spec) == 1 && (Synergy) && IsClientConnected(client) && IsClientInGame(client))
	{
		if (IsPlayerAlive(client) && !IsSpec[client])
		{
			IsSpec[client] = true
			ForcePlayerSuicide(client)
			PrintToChat(client, "\x01\x04[SYN] %T", "Notice_Spec", LANG_SERVER)
			PrintToChat(client, "\x01\x04[SYN]  %T", "Notice_Spec2", LANG_SERVER)
			if (Debug)
				PrintToChat(client, "Moved to Spec")
			return Plugin_Handled
		}
		else if (!IsPlayerAlive(client) && IsSpec[client])
		{
			/*ForcePlayerSuicide(client)*/
			CreateTimer(0.5, DO_SpawnPlayer, client)
			if (Debug)
				PrintToChat(client, "Moved out of Spec")
			return Plugin_Handled
		}
		else if (!IsPlayerAlive(client) && !IsSpec[client])
		{
			PrintToChat(client, "Can't change to Spectator while dead.")
			return Plugin_Handled
		}
		else
		{
			PrintToChat(client, "Failed. Please contact the author.")
			return Plugin_Handled
		}
	}
	return Plugin_Handled
}